﻿using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Windows;
using NetBay.Core.BusinessEntities;
using Rio.Framework.Pages.AppCode.Enums;

namespace Rio.Framework.Pages.Controls.BaseClass
{
    public class OrganizationTypePanelBase : ControlBase, INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;
        private ObservableCollection<FolderType> _folderTypes;
        private ObservableCollection<Organization> _organizations;

        public ObservableCollection<Organization> Organizations
        {
            get { return _organizations; }
            set
            {
                _organizations = value;
                OnPropertyChanged("Organizations");
            }
        }

        public ObservableCollection<FolderType> FolderTypes
        {
            get { return _folderTypes; }
            set
            {
                _folderTypes = value;
                OnPropertyChanged("FolderTypes");
            }
        }

        public AppDisplayMode Mode
        {
            get { return (AppDisplayMode)GetValue(ModeProperty); }
            set { SetValue(ModeProperty, value); }
        }
        public static readonly DependencyProperty ModeProperty =
            DependencyProperty.Register("Mode", typeof(AppDisplayMode), typeof(OrganizationTypePanelBase), null);

        public Organization SelectedOrganization
        {
            get { return (Organization)GetValue(SelectedOrganizationProperty); }
            set { SetValue(SelectedOrganizationProperty, value); }
        }
        public static readonly DependencyProperty SelectedOrganizationProperty =
            DependencyProperty.Register("SelectedOrganization", typeof(Organization), typeof(OrganizationTypePanelBase), null);

        public FolderType SelectedFolderType
        {
            get { return (FolderType)GetValue(SelectedFolderTypeProperty); }
            set { SetValue(SelectedFolderTypeProperty, value); }
        }
        public static readonly DependencyProperty SelectedFolderTypeProperty =
            DependencyProperty.Register("SelectedFolderType", typeof(FolderType), typeof(OrganizationTypePanelBase), null);

        /// <summary>
        /// Called when [notify property changed].
        /// </summary>
        /// <param name="propertyName">Name of the property.</param>
        public void OnPropertyChanged(string propertyName)
        {
            if (this.PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        public override void InitLabel()
        {
        }
    }
}
